package timeUtil

import (
	"time"
)

func GetAcctDay(cycle string) string {
	parse, err := time.Parse("200601", cycle)
	if err != nil {
		panic("时间格式错误!" + cycle)
	}
	date := parse.AddDate(0, 1, 0)
	format := date.Format("20060102")
	return format
}

func GetSysDate() string {
	now := time.Now()
	format := now.Format("2006-01-02")
	return format + " 00:00:00"
}

func GetPreDate() string {
	now := time.Now()
	format := now.AddDate(0, 0, -1).Format("2006-01-02")
	return format + " 00:00:00"
}

func GetSysTime() string {
	now := time.Now()
	format := now.Format("2006-01-02 15:04:05")
	return format
}
